	def members
		@members = Member.paginate(:per_page => 10, :page => params[:page], :order => "created_at DESC")
	end
	
	def add_member
	  @member = Member.new
  end

	def edit_member
		@member = Member.find_by_id(params[:id])
	end

	def create_member
		@member = Member.new(params[:member])
		@member.content = params[:message]
		if @member.save
			flash[:notice] = "添加成功"
		else
			flash[:notice] = "添加失败"
		end
		redirect_to :action => :members
	end

	def up_member
		@member = Member.find_by_id(params[:id])
		@member.content = params[:message]
		if @member.update_attributes(params[:member])
			flash[:notice] = "更新成功"
		else
			flash[:notice] = "更新失败"
		end
		redirect_to :action => :members
	end

  def destroy_member
		member = Member.find(params[:id])
    member.destroy
		redirect_to :action => :members
  end 


